import os

cmd = 'start cmd.exe'
os.system(cmd)

# os.system(r"C:\Users\admin\AppData\Roaming\secoresdk\360se6\Application\360se.exe")

# os.system(' start cmd.exe /K C:\\Users\\admin\\AppData\\Roaming\\secoresdk\\360se6\\Application\\360se.exe ')

# os.system(' start cmd.exe E:\\python\test ')

# os.chdir( "E:\\python\test")

# os.system(' start cmd.exe')

# os.system(' mkdir aaa.txt ')


# with open("test.txt","w",encoding="utf8") as file1:
#     mystr = os.popen("ipconfig")  # popen与system可以执行指令,popen可以接受返回对象
#     mystr = mystr.read()  # 读取输出
#     file1.write(mystr)     #写入文件

with open("ipconfig.txt", "w", encoding="utf8") as file1:
    mystr = os.popen("ipconfig")  # popen与system可以执行指令,popen可以接受返回对象
    mystr = mystr.read()  # 读取输出
    file1.write(mystr)  # 写入文件